#ifndef CABRILLO_CONFIG_H
#define CABRILLO_CONFIG_H

#include <string>
#include <map>

class CabrilloConfig {
private:
    std::map<std::string, std::string> configMap;
    static CabrilloConfig* instance;
    
    // Private constructor for singleton pattern
    CabrilloConfig();
    
public:
    // Singleton instance access
    static CabrilloConfig* getInstance();
    
    // Delete copy constructor and assignment operator for singleton
    CabrilloConfig(const CabrilloConfig&) = delete;
    CabrilloConfig& operator=(const CabrilloConfig&) = delete;
    
    // Load configuration from file
    bool loadConfig(const std::string& configFile);
    
    // Get configuration value by key
    std::string get(const std::string& key) const;
    
    // Get configuration value by key with default value
    std::string get(const std::string& key, const std::string& defaultValue) const;
    
    // Check if a key exists in configuration
    bool hasKey(const std::string& key) const;
    
    // Get all configuration as map
    const std::map<std::string, std::string>& getAllConfig() const;
    
    // Save configuration to file
    bool saveConfig(const std::string& configFile);
    
    // Set configuration value
    void set(const std::string& key, const std::string& value);
};

#endif // CABRILLO_CONFIG_H